const Mock = require('mockjs');

module.exports = {
  'GET /api/posts': (req, res) => {
    res.status(200).json({
      users: Mock.mock({
        'data|50': [
          {
            id: '@id',
            name: '@name',
            nickName: '@last',
            phone: /^1[345789]\d{9}$/,
            'age|11-99': 1,
            address: '@county(true)',
            isMale: '@boolean',
            email: '@email',
            createTime: '@datetime',
            avatar() {
              return Mock.Random.image('200x200', '#894FC4', '#FFF', 'png', 'B')
            }
          }
        ]
      })
    })
  }
}